#define outputPin (6)

// stands for 100 `C
#define MAX_TEM_ADC (525.0)

// stands for 0 `C
#define MIN_TEM_ADC (688.0) 

// when tempreture is 0 `C 
#define MAX_TEM_DGT (255.0) 

// when tempreture is 100 `C. That is, led turn lighter when it is cold 
#define MIN_TEM_DGT (0.0)

void setup() {
  // put your setup code here, to run once:
	pinMode(outputPin, OUTPUT);
}

void loop() {
        // put your main code here, to run repeatedly:
	float adc = analogRead(A0);
	// change adc according to the tempreture
	adc = (adc-MIN_TEM_ADC)/(MAX_TEM_ADC-MIN_TEM_ADC)*(MAX_TEM_DGT-MIN_TEM_DGT)+MIN_TEM_DGT;
	analogWrite(outputPin, adc);
}

